package homework;

import org.apache.commons.collections.functors.ForClosure;

public class Test3 {
	/**
	 * 测试可变参数     
	 * 
	 * @author chenqy       
	 */
	public static void printArg(String... strings) {
		System.out.println("方法一：\n strings.length=" + strings.length);
		for (int i = 0; i < strings.length; i++) {
			System.out.print(strings[i] + "");
		}
	}

	public static void printArg(String str, String[] strings) {
		System.out.println("方法二：\n ");
		System.out.println(" strings.length=" + strings.length);
		for (int i = 0; i < strings.length; i++) {
			System.out.print(strings[i] + "");
		}
	}

	public static void main(String[] args) {
		// 调用方法一
		Test3.printArg();
		Test3.printArg("a", "b", "c");
		Test3.printArg("a", "b", "c", "d");
		String[] strings = { "a", "b", "c" };
		// 调用方法二    
		Test3.printArg("eee", strings);
	}
}
